home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Programming / LEDA / prog / graph / comp.c < prev    next >
C/C++ Source or Header  |  1994-08-05  |  675b  |  42 lines

  1. #include <LEDA/graph.h>
  2. #include <LEDA/ugraph.h>
  3. #include <LEDA/graph_alg.h>
  4.  
  5.  
  6. main(int argc, char** argv)
  7. {
  8.  
  9. GRAPH<int,int> G;
  10.  
  11. cmdline_graph(G,argc,argv);
  12.  
  13. ugraph G2(G);
  14.  
  15. node_array<int> compnum(G2);
  16. node_array<int> compnum1(G2);
  17.  
  18. float T = used_time();
  19. cout << "COMPONENTS   ";
  20. cout.flush();
  21. COMPONENTS(G2,compnum);
  22. cout << string("   %6.2f sec \n",used_time(T));
  23. newline;
  24.  
  25. cout << "COMPONENTS 1 ";
  26. cout.flush();
  27. COMPONENTS1(G2,compnum1);
  28. cout << string("   %6.2f sec \n",used_time(T));
  29.  
  30.  
  31. if (Yes("ausgabe?")) 
  32.  { node v;
  33.    forall_nodes(v,G2) 
  34.    { G2.print_node(v);
  35.      cout << string("  c = %3d   c1 = %3d \n", compnum[v],compnum1[v]);
  36.     }
  37.   }
  38. newline;
  39.  
  40. return 0;
  41. }
  42.